package com.elm.orders.mapper;

import com.elm.orders.pojo.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrdersMapper {

    void createOrders(Orders orders);

    @Select("select * from orders where orderId=#{orderId}")
    Orders getOrdersById(Integer orderId);

    @Select("select * from orders where userId=#{userId}")
    List<Orders> listOrdersByUserId(String userId);

    @Update("update orders set orderState=1 where orderId=#{orderId}")
    void update(Integer orderId);
}
